//
//  main.m
//  多态
//
//  Created by mir_yan on 2018/9/29.
//  Copyright © 2018年 hakeem. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Coder.h"
#import "Photographer.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        
        Coder* c1 = [[Coder alloc] init];
        Photographer* p1 = [[Photographer alloc] init];
        
//        [c1 yueMa];
//        [p1 yueMa];
        
        id simple = nil;
        
        // simple 系统自动simple 所属类型
        simple = c1;
        [simple yueMa];
        
        simple = p1;
        [simple yueMa];
        
        // id 动态类型  不易在编译时差错
        
        NSLog(@"Hello, World!");
    }
    return 0;
}
